# from machine import Pin, SPI

# clk = Pin(("clk", 26), Pin.OUT_PP)
# mosi = Pin(("mosi", 27), Pin.OUT_PP)
# miso = Pin(("miso", 28), Pin.IN)
# spi = SPI(-1, 500000, polarity = 0, phase = 0, bits = 8, firstbit = 0, sck = clk, mosi = mosi, miso = miso)
# print(spi)
# spi.write("hello rt-thread!")
# spi.read(10)
# b'\x00\x00\x00\x00\x00\x00\x00\x00\x00\x00'
 

from machine import Pin,SPI
from ssd1306 import SSD1306_SPI

scl = Pin(("scl", 5), Pin.OUT_PP)
sda = Pin(("sda", 7), Pin.OUT_PP)
res = Pin(("res", 6), Pin.OUT_PP, value=0)
dc = Pin(("dc", 4), Pin.OUT_PP, value=0)

spi = SPI(-1, 500000, polarity = 0, phase = 0, bits = 8, firstbit = 0, sck = scl, mosi = sda, miso=None)
oled = SSD1306_SPI(128, 64, spi, dc = dc, res = res, cs=None) #4=dc 5=res 10=cs
 
# oled.text("First line", 0, 0, 1)
# oled.text("Second line", 0, 8, 1)
# oled.text("Third line", 0, 16, 1)
# oled.text("Forth line", 0, 24, 1)
# oled.text("Fifth line", 0, 32, 1)
# oled.text("Sixth line", 0, 40, 1)
# oled.text("Seventh line", 0, 48, 1)
# oled.text("Last line", 0, 56, 1)
# oled.show()
print(1)
